package jsyf.oa.web.intentCustomerReportNew;

import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import jsyf.com.util.BaseUtils;
import jsyf.com.util.ResponseUtils;
import jsyf.oa.facade.intentCustomerReportNew.IntentCustomerReportNewFacade;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by 92852 on 2018/9/4.
 */
@Api(value = "新意向客户报表接口", description = "新意向客户报表接口")
@Controller
@RequestMapping("/intentCustomerNew")
public class IntentCustomerReportNewController {
    @Resource
    private IntentCustomerReportNewFacade intentCustomerReportNewFacade;

    @ResponseBody
    @RequestMapping(value = "/getForGroupIntentCustomerList.json", method = RequestMethod.POST)
    @ApiOperation(
            value = "获取集团意向客户",
            notes = "获取集团意向客户",
            httpMethod = "POST",
            produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiImplicitParam(name = "jsonData", value = "{'userId':''}", dataType = "String", paramType = "body")
    public void getForGroupIntentCustomerList(HttpServletResponse response, @RequestBody String jsonData) {
        List<JSONObject> jsonObjectList = intentCustomerReportNewFacade.getForGroupIntentCustomerList(jsonData);
        ResponseUtils.putJsonResponse(response, BaseUtils.succsessArrRespond(jsonObjectList));
    }

    @ResponseBody
    @RequestMapping(value = "/getAllReportCustomer.json", method = RequestMethod.POST)
    @ApiOperation(
            value = "获取全部意向客户",
            notes = "获取全部意向客户",
            httpMethod = "POST",
            produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiImplicitParam(name = "jsonData", value = "{userId:'',key:''}", dataType = "String", paramType = "body")
    public void getAllReportCustomer(HttpServletResponse response, @RequestBody String jsonData) {
        JSONObject jsonObjectList = intentCustomerReportNewFacade.getAllReportCustomer(jsonData);
        ResponseUtils.putJsonResponse(response, BaseUtils.succsessObjRespond(jsonObjectList));
    }

    @ResponseBody
    @RequestMapping(value = "/getForDepartByCompanyId.json", method = RequestMethod.POST)
    @ApiOperation(
            value = "获取集团下公司",
            notes = "获取集团下公司",
            httpMethod = "POST",
            produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiImplicitParam(name = "jsonData", value = "{companyId:''，key:''}", dataType = "String", paramType = "body")
    public void getForDepartByCompanyId(HttpServletResponse response, @RequestBody String jsonData) {
        List<JSONObject> jsonObjectList = intentCustomerReportNewFacade.getForDepartByCompanyId(jsonData);
        ResponseUtils.putJsonResponse(response, BaseUtils.succsessArrRespond(jsonObjectList));
    }

    @ResponseBody
    @RequestMapping(value = "/getForPersonalIntentCustomerList.json", method = RequestMethod.POST)
    @ApiOperation(
            value = "获取个人意向客户",
            notes = "获取个人意向客户",
            httpMethod = "POST",
            produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiImplicitParam(name = "jsonData", value = "{'userId':'',key:''}", dataType = "String", paramType = "body")
    public void getForPersonalIntentCustomerList(HttpServletResponse response, @RequestBody String jsonData) {
        JSONObject jsonObjectList = intentCustomerReportNewFacade.getForPersonalIntentCustomerList(jsonData);
        ResponseUtils.putJsonResponse(response, BaseUtils.succsessObjHourRespond(jsonObjectList));
    }


    @ResponseBody
    @RequestMapping(value = "/getForCompanyIntentCustomerList.json", method = RequestMethod.POST)
    @ApiOperation(
            value = "获取公司意向客户",
            notes = "获取公司意向客户",
            httpMethod = "POST",
            produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiImplicitParam(name = "jsonData", value = "{'userId':''}", dataType = "String", paramType = "body")
    public void getForCompanyIntentCustomerList(HttpServletResponse response, @RequestBody String jsonData) {
        List<JSONObject> jsonObjectList = intentCustomerReportNewFacade.getForCompanyIntentCustomerList(jsonData);
        ResponseUtils.putJsonResponse(response, BaseUtils.succsessArrRespond(jsonObjectList));
    }


    @ResponseBody
    @RequestMapping(value = "/getForDepartIntentCustomerList.json", method = RequestMethod.POST)
    @ApiOperation(
            value = "获取部门意向客户",
            notes = "获取部门意向客户",
            httpMethod = "POST",
            produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiImplicitParam(name = "jsonData", value = "{'userId':''}", dataType = "String", paramType = "body")
    public void getForDepartIntentCustomerList(HttpServletResponse response, @RequestBody String jsonData) {
        List<JSONObject> jsonObjectList = intentCustomerReportNewFacade.getForDepartIntentCustomerList(jsonData);
        ResponseUtils.putJsonResponse(response, BaseUtils.succsessArrRespond(jsonObjectList));
    }











}
